package com.example.myserver;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class MainActivity2 extends AppCompatActivity {
private Button button,button2;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main2);
        button = findViewById(R.id.button);
        button2 = findViewById(R.id.button2);
        Button button3 = findViewById(R.id.button3);
        button3.setOnClickListener(v -> startActivity(new Intent(this,MainActivity3.class)));
        button.setOnClickListener(v->startIntentService());
        button2.setOnClickListener(v -> startService());
    }
    public void startService(){
        Intent intent = new Intent(this,MyService.class);
        startService(intent);
    }
    public void startIntentService(){
        Intent intent = new Intent(this,MyIntentService.class);
        startService(intent);
    }
}